
const app = getApp();

Page({
  data: {
    listData: {
      onItemTap: 'handleListItemTap',
      data: [],
    },
    summList:[],
  },
  handleListItemTap(e) {
    var index = e.currentTarget.dataset.index;
    var rId = this.data.listData.data[index].id;
    dd.navigateTo({
      url: '../report/report?rId=' + rId,
    })
  },
 onShow(options) {
    var that =this;
    var url = app.globalData.url;
    var summList = this.data.summList;
    dd.httpRequest({ 
            url:url+'/api/BusinessSummary/selBusinessSummary',
            method:'post',
            datatype:'json',
            success:function(res){
              res.data.data.forEach(function (item,index){
                  summList.push({
                      'title': res.data.data[index].rName,
                      'arrow': 'horizontal',
                      'extra': res.data.data[index].rFzr,
                      'id': res.data.data[index].rId
                  })
                  that.setData({
                    'listData.data':summList,
                  })
              });
            } 
    });
  },
});
